package com.google.code.swingonfire.builder;

import javax.swing.JCheckBox;

public class JCheckBoxBuilder extends AbstractJComponentBuilder<JCheckBoxBuilder, JCheckBox>
{

    private Boolean selected;

    public JCheckBoxBuilder()
    {
        super(JCheckBox.class);
    }

    public JCheckBoxBuilder selected(boolean selected)
    {
        this.selected = Boolean.valueOf(selected);

        return this;
    }

    @Override
    protected void populate(JCheckBox component)
    {
        super.populate(component);

        if (selected != null)
        {
            component.setSelected(selected.booleanValue());
        }
    }

}
